﻿@{
    ViewBag.Title = "日志管理_按用户（账户）查询";
}
<script type="text/javascript">
    $(document).ready(function () {
        GridGet_SelectUser();
    });

    function GridGet_SelectUser() {
        $("#List_Permission_Log_SelectUser").jqGrid({
            url: "/Permission/Log/SelectSingleUser",
            datatype: "json",
            mtype: "post",
            colNames: ['Id', '用户名', '姓名', '部门', '描述'],
            colModel: [
                        { name: 'Id', index: 'LogId', width: 10, align: "center", sortable: false, hidden: true },
                        { name: 'UserName', index: 'UserName', width: 120, align: "center", sortable: false },
                        { name: 'RealName', index: 'RealName', width: 80, align: "center", sortable: false },
                        { name: 'DepartmentName', index: 'DepartmentName', width: 150, align: "center", sortable: false },
                        { name: 'Description', index: 'Description', width: 100, align: "center", sortable: false }
                       ],
            loadError: function (xhr, status) {
                alertMsg.error(xhr.responseText);
            },
            loadComplete: function (xhr) {
                var ajaxbg = $("#background,#progressBar,#lui_List_Permission_Log_SelectUser");
                ajaxbg.hide();
            },
            onSelectRow: User_GetUserList,
            autowidth: true,
            shrinkToFit: true,
            multiselect: false,
            multiselectWidth: 50,
            sortable: false,
            viewrecords: true,
            sortorder: "desc",
            jsonReader: {
                repeatitems: false
            },
            height: 255
        }).navGrid('#pager_Permission_Log_SelectUser', { edit: false, add: false, del: false, refresh: false, search: false });
    }
    //选中某一行，获得行
    function User_GetUserList(id) {
        var GridObj = $("#List_Permission_Log_SelectUser");
        var tempID = GridObj.getCell(parseInt(id), "Id").toString();

        var tempUserName = GridObj.getCell(parseInt(id), "UserName").toString();
        if ("@ViewBag.Flag" == "1") {
            $("#userId_SelectUser").val(tempID);
            $("#txtUserName_SelectUser").val(tempUserName);
        } else if ("@ViewBag.Flag" == "2") {
            $("#userId_QueryDate").val(tempID);
            $("#txtUserName_QueryDate").val(tempUserName);
        }
        return tempID;
    }
    //模块查询操作
    $("#txtkeyword_Permission_Log_SelectUser").keyup(
        function () {
            $("#List_Permission_Log_SelectUser tr:gt(0)").hide();
            var $d = $("#List_Permission_Log_SelectUser tr:gt(0)").filter(":contains('" + $.trim($("#txtkeyword_Permission_Log_SelectUser").val()) + "')");
            $d.show();
        }
      )
    //点击确定按钮操作
    $("#btnSure_Permission_Log_SelectUser").click(function () {
        $.pdialog.closeCurrent();
    });
</script>
<div class="pageContent" layouth="38">
    <ul class="searchBar">
        <li><span>关键字：</span>
            <input type="text" id="txtkeyword_Permission_Log_SelectUser" />
        </li>
        <li>
            <input class="btn btn-success btn-xs" type="button" id="btnQuery_Permission_Log_SelectUser"
                value="搜索" />
        </li>
    </ul>
    <table id="List_Permission_Log_SelectUser">
    </table>
    <div id="pager_Permission_Log_SelectUser">
    </div>
</div>
<div class="formBar">
    <ul>
        <li>
            <button type="button" class="btn btn-success btn-sm" id="btnSure_Permission_Log_SelectUser">
                确定</button>
        </li>
        <li>
            <button type="button" class="close btn btn-default btn-sm">
                取消</button>
        </li>
    </ul>
</div>
